﻿CREATE TABLE [structure].[ItemVersion]
(
[ItemId] [uniqueidentifier] NOT NULL,
[Version] [int] NOT NULL,
[LeftVersion] [int] NULL,
[RightVersion] [int] NULL,
[Comment] [varchar] (255) NULL,
[Name] [varchar] (255) NOT NULL,
[MimeType] [varchar] (50) NOT NULL,
[SpecificationId] [uniqueidentifier] NOT NULL,
[CreatedBy] [varchar] (255) NOT NULL,
[LastModified] [datetime] NOT NULL,
[PropertyData] [varbinary] NULL,
[RowIdentifier] [uniqueidentifier] NOT NULL ROWGUIDCOL
) ON [PRIMARY]


GO
EXEC sp_addextendedproperty N'MS_Description', N'Version Number', 'SCHEMA', N'structure', 'TABLE', N'ItemVersion', 'COLUMN', N'Version'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Parent Version this Version drives from (0 = no parent)', 'SCHEMA', N'structure', 'TABLE', N'ItemVersion', 'COLUMN', N'LeftVersion'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Optional second Version merged with LeftVersion when creating this Version', 'SCHEMA', N'structure', 'TABLE', N'ItemVersion', 'COLUMN', N'RightVersion'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Optional comment added when this version was created', 'SCHEMA', N'structure', 'TABLE', N'ItemVersion', 'COLUMN', N'Comment'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Name used to identify this item in the heirarchy.  Used as a path segment in the URI', 'SCHEMA', N'structure', 'TABLE', N'ItemVersion', 'COLUMN', N'Name'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Multipurpose Internet Mail Extensions (content type of the item)', 'SCHEMA', N'structure', 'TABLE', N'ItemVersion', 'COLUMN', N'MimeType'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Unique Id that is associated with an Item Specification which defines the extended model properties stored in ItemProperties.', 'SCHEMA', N'structure', 'TABLE', N'ItemVersion', 'COLUMN', N'SpecificationId'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Principal who created this version of the  Item', 'SCHEMA', N'structure', 'TABLE', N'ItemVersion', 'COLUMN', N'CreatedBy'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Last Modified Time for this  Version.  Note that the last modified time of the resource may be different than the heirarchy data', 'SCHEMA', N'structure', 'TABLE', N'ItemVersion', 'COLUMN', N'LastModified'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Binary Serialized Property Data.  This field stores the extensible properties for each item', 'SCHEMA', N'structure', 'TABLE', N'ItemVersion', 'COLUMN', N'PropertyData'

